﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace YJKInspectModel.ModelValidation.ClearHeightCheck
{
	public class CategoryItem
	{
		public CategoryItem(int id, string sname, bool isSelected)
		{
			this.m_categotyId = id;
			this.m_sName = sname;
			this.m_Selected = isSelected;
		}

		public CategoryItem(Category category)
		{
			this.m_categotyId = category.Id.IntegerValue;
			this.m_sName = category.Name;
		}

		public int CategoryId()
		{
			return this.m_categotyId;
		}

		public string CategoryName()
		{
			return this.m_sName;
		}

		public bool Selected
		{
			get
			{
				return this.m_Selected;
			}
		}

		public void AddObjectTypeItem(List<ObjectTypeItem> objectTypeList)
		{
			this.m_objectTypeList.AddRange(objectTypeList);
		}

		public void AddObjectTypeItem(ObjectTypeItem objectTypeItem)
		{
			using (List<ObjectTypeItem>.Enumerator enumerator = this.m_objectTypeList.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					if (enumerator.Current.getTypeName().Equals(objectTypeItem.getTypeName()))
					{
						return;
					}
				}
			}
			this.m_objectTypeList.Add(objectTypeItem);
		}

		public List<ObjectTypeItem> ObjectTypeItemList
		{
			get
			{
				return this.m_objectTypeList;
			}
		}

		public void SetSelected(bool selected)
		{
			this.m_Selected = selected;
			foreach (ObjectTypeItem objectTypeItem in this.m_objectTypeList)
			{
				objectTypeItem.SetSelected(selected);
			}
		}

		private string m_sName = "";

		private int m_categotyId;

		private bool m_Selected = true;

		private List<ObjectTypeItem> m_objectTypeList = new List<ObjectTypeItem>();
	}
}
